package day3;

class DataWrap{
    int a;
    int b;
}

public class ReferenceTransferTest {

    public static void swap(DataWrap dw){
        int tmp = dw.a;
        dw.a = dw.b;
        dw.b = tmp;
        System.out.println("引用传值--swap里面的值a="+dw.a+";b="+dw.b);
        dw = null;
    }

    public void test(){

        DataWrap dw =   new DataWrap();
        dw.a =  6;
        dw.b= 9;
        swap(dw);
        System.out.println("引用传值--交换后的值a="+dw.a+";b="+dw.b);

    }

}
